package com.example;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-07-14
 */
public class Demo02 {
  public static void main(String[] args) {
    //
    int result = multiply(4);
    System.out.println(result);
  }
  //n的阶乘
  static int multiply(int n){

      if(n==0){
          return 1;
      }
      int j= 1;
      for(int i=1;i<=n;i++){
        j *= i;
      }
      return j;
  }
}
